Skip to content

Conversation

@arsenm
Copy link
Contributor

@arsenm arsenm commented Apr 18, 2025

No description provided.

Copy link
Contributor Author

arsenm commented Apr 18, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

@arsenm arsenm added the openmp label Apr 18, 2025 — with Graphite App
@arsenm arsenm marked this pull request as ready for review April 18, 2025 19:20
@llvmbot llvmbot added llvm:transforms clang:openmp OpenMP related changes to Clang labels Apr 18, 2025
@llvmbot
Copy link
Member

llvmbot commented Apr 18, 2025

@llvm/pr-subscribers-llvm-transforms

@llvm/pr-subscribers-openmp

Author: Matt Arsenault (arsenm)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/136349.diff

1 Files Affected:

  • (modified) llvm/lib/Transforms/IPO/OpenMPOpt.cpp (+1-1)
diff --git a/llvm/lib/Transforms/IPO/OpenMPOpt.cpp b/llvm/lib/Transforms/IPO/OpenMPOpt.cpp
index d055a22f10ebb..594f266cc8650 100644
--- a/llvm/lib/Transforms/IPO/OpenMPOpt.cpp
+++ b/llvm/lib/Transforms/IPO/OpenMPOpt.cpp
@@ -1535,7 +1535,7 @@ struct OpenMPOpt {
     // safely remove it.
     // TODO: This should be somewhere more common in the future.
     if (GlobalVariable *GV = M.getNamedGlobal("__llvm_rpc_client")) {
-      if (GV->getNumUses() >= 1)
+      if (GV->hasNUsesOrMore(1))
         return false;
 
       GV->replaceAllUsesWith(PoisonValue::get(GV->getType()));

// TODO: This should be somewhere more common in the future.
if (GlobalVariable *GV = M.getNamedGlobal("__llvm_rpc_client")) {
if (GV->getNumUses() >= 1)
if (GV->hasNUsesOrMore(1))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (GV->hasNUsesOrMore(1))
if (!GV->use_empty())

Would be more typical?

Copy link
Contributor Author

arsenm commented Apr 18, 2025

Merge activity

  • Apr 18, 5:15 PM EDT: A user started a stack merge that includes this pull request via Graphite.
  • Apr 18, 5:17 PM EDT: A user merged this pull request with Graphite.

@arsenm arsenm merged commit f2c175f into main Apr 18, 2025
17 checks passed
@arsenm arsenm deleted the users/arsenm/openmp-opt/avoid-get-num-uses branch April 18, 2025 21:17
IanWood1 pushed a commit to IanWood1/llvm-project that referenced this pull request May 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clang:openmp OpenMP related changes to Clang llvm:transforms openmp

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants